"""
URL configuration for cbv project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path,include
# from book import views
from sers import views
from rest_framework import routers

# 针对 viewset 的路由注册写法
router = routers.DefaultRouter()
router.register(r'salary', views.SalaryViewSet)

urlpatterns = [
    path("admin/", admin.site.urls),
    # # path('book/', views.BookView.as_view()),
    # path('sers/book/', views.BookView.as_view()),
    # re_path('sers/book/(\d+)/', views.BookDetailView.as_view()),
    # path('sers/publish/', views.PublishGenericAPIView.as_view()),
    # re_path('sers/publish/(?P<pk>\d+)/', views.PublishDetailView.as_view()),
    # path('sers/author/', views.AuthorGenericAPIView.as_view()),
    # re_path('sers/author/(?P<pk>\d+)/', views.AuthorDetailView.as_view()),
    # path('sers/stuff/', views.StuffMinInView.as_view()),
    # re_path('sers/stuff/(?P<pk>\d+)/', views.StuffMinInDetailView.as_view()),
    # # path('sers/salary/',views.SalaryViewSet.as_view({"get":"get_all","post":"create_data"})),
    # # re_path('sers/salary/(?P<pk>\d+)',views.SalaryViewSet.as_view({"get":"get_single_data","put":"update_data",'delete':'delete_data'})),
    # # path('sers/salary/', views.SalaryViewSet.as_view({"get": "list", "post": "create"})),
    # # re_path('sers/salary/(?P<pk>\d+)',
    # #         views.SalaryViewSet.as_view({"get": "retrieve", "put": "update", 'delete': 'destroy'})),
    # path('sers/', include(router.urls)),
    path('app/',include('app01.urls'))
]